/**
 * Copyright (C) 2011 ChangSha XNS Science & Technology CO,.LTD. All rights reserved.
 * XNS PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */

/**
 * Copyright (C) 2002-2011 WUZEWEN. All rights reserved.
 * WUZEWEN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 *
 * This software is the confidential and proprietary information of
 * WuZeven, Personal. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with WuZeven.
 */

package com.kingcore.pda.database.bean;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * <p>java类文件的说明...</p>
 * @author Zeven/wzw on Nov 28, 2011
 * @version	1.0
 * @see		Object#equals(java.lang.Object)
 * @since	JDK5
 */

public class DatabaseColumnBean implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String name ;
	private String label ;
	private String comment;
	private String type;
	private String nullable; 
	private int isAutoincrement = 0; 
	private int isPrimaryKey = 0; 
	private String length ;  //数据库保存长度
	
	// ------------- 以下是扩展属性，主要是界面相关
	private String editHide = "0" ;  //	1：隐藏；0：显示
	private String listHide = "0" ;  //	1：隐藏；0：显示
	private String required = "0" ;  //	1：必填；0：可填。同时结合字段not null属性
	private String readOnly = "0" ;  // 1:只读; 0:可编辑
	private String colspan = "1" ;  //	1：占一格；n：占n格
	private String fieldType = "text" ;  //	Text,textarea,list(不分大小写)。同时结合字段length属性
	private String tooltip = "" ;  //	提示文字，默认为空
	// == 以下未完成部分
	private String width = "15%";  //	(0%=100%)或具体像素值
	private String order = "99"; //	0-列数。 默认查询返回的顺序
	// ------------- end of 以下是扩展属性，主要是界面相关

	private Map<String,String> ext = new HashMap<String,String>();  //更多扩展属性
	
	/**
	 * <p>java方法的说明...</p>
	 * @author Zeven on Nov 28, 2011
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}
 
	
	
	public Map<String, String> getExt() {
		return ext;
	}



	public void setExt(Map<String, String> ext) {
		this.ext = ext;
	}

	

	public String getTooltip() {
		return tooltip;
	}



	public void setTooltip(String tooltip) {
		this.tooltip = tooltip;
	}



	public String getReadOnly() {
		return readOnly;
	}

	public void setReadOnly(String readOnly) {
		this.readOnly = readOnly;
	}

	public String getEditHide() {
		return editHide;
	}




	public void setEditHide(String editHide) {
		this.editHide = editHide;
	}




	public String getListHide() {		
		if ("1".equals(this.editHide)) { //编辑隐藏则列表也隐藏
			return "1";
		}
		
		return listHide;
	}




	public void setListHide(String listHide) {
		this.listHide = listHide;
	}




	public String getColspan() {
		return colspan;
	}




	public void setColspan(String colspan) {
		this.colspan = colspan;
	}




	public String getRequired() {
		return required;
	}




	public void setRequired(String required) {
		this.required = required;
	}




	public String getFieldType() {
		return fieldType;
	}




	public void setFieldType(String fieldType) {
		this.fieldType = fieldType.toLowerCase();  //全部转为小写，不区分大小写
	}




	public String getWidth() {
		return width;
	}




	public void setWidth(String width) {
		this.width = width;
	}




	public String getOrder() {
		return order;
	}




	public void setOrder(String order) {
		this.order = order;
	}
	// -----------------------  界面展示属性开始


	// -----------------------  数据存储属性开始
	public int getIsPrimaryKey() {
		return isPrimaryKey;
	}



	public void setIsPrimaryKey(int isPrimaryKey) {
		this.isPrimaryKey = isPrimaryKey;
	}



	public String getLength() {
		return length;
	}


	public void setLength(String length) {
		this.length = length;
	}


	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getComment() {
		return comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	public String getNullable() {
		return nullable;
	}

	public void setNullable(String nullable) {
		this.nullable = nullable;
	}

	public int getIsAutoincrement() {
		return isAutoincrement;
	}

	public void setIsAutoincrement(int isAutoincrement) {
		this.isAutoincrement = isAutoincrement;
	}

	public String getLabel() {
		return label;
	}

	public void setLabel(String label) {
		this.label = label;
	}

}
